I found out that I could put "{ }" around my code when there isn't any function, conditions, etc, attached to it. I mean that I can succesfully compile such a code:
Well, so you see I mean the inner set of "{ }", there isn't any function or condition to it such as "main() {}" but though, declarations in that inner "body" of the "main" are scoped so I can't access them outside of that inner "body"... I don't know if this as a usefullness, or if this is just a flaw in the compiler (MSVC++) but I don't see how it could be usefull.Code:int main() { int a = 1; { int b = 1; } //b is unknown here... //a is known here... return 0; }
I also tried to see if I could place "break" statement inside of it, to get directly to the end of the inner {}, but it doesn't work, as there is no loop or switch...
Any clue to this special thing?